﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data.Odbc;
using System.Data.OleDb;
using System.Configuration;
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
         String ConString = ConfigurationManager.ConnectionStrings["myDBConnection"].ConnectionString;
         using (SqlConnection connection = new SqlConnection(ConString))
         {
             connection.Open();
             SqlCommand command = new SqlCommand("sendpic", connection);
             command.CommandType = System.Data.CommandType.StoredProcedure;

             command.Parameters.AddWithValue("@imageID", TextBox1.Text);
             command.Parameters.AddWithValue("@myPic", FileUpload1.FileBytes);

             command.ExecuteNonQuery();
          

             connection.Close();

         }
    }
}